package com.stellar.circle.controller.admin.sCommentSensitiveLog;

import com.stellar.circle.controller.admin.sCommentSensitiveLog.vo.SCommentSensitiveLogRequestPageVO;
import com.stellar.circle.controller.admin.sCommentSensitiveLog.vo.SCommentSensitiveLogRequestVO;
import com.stellar.circle.controller.admin.sCommentSensitiveLog.vo.SCommentSensitiveLogResponseVO;
import com.stellar.circle.domain.sCommentSensitiveLog.SCommentSensitiveLogDomainService;
import com.stellar.web.core.bean.PageResult;
import com.stellar.web.core.bean.Result;
import com.stellar.web.core.validator.ValidatorRole;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 评论敏感词记录表控制器
 * @author Jqchan
 * @version 1.0
 * @date 2025-05-19 14:52:51
 */
@RequestMapping("/api-admin/sCommentSensitiveLog")
@RestController("adminSCommentSensitiveLogController")
@Slf4j
public class SCommentSensitiveLogController {

    @Resource
    private SCommentSensitiveLogDomainService sCommentSensitiveLogDomainService;

    /**
     * 分页查询评论敏感词记录表
     */
    @ValidatorRole
    @PostMapping("/page")
    public Result<PageResult<SCommentSensitiveLogResponseVO>> page(@RequestBody SCommentSensitiveLogRequestPageVO requestPageVO) {
        return Result.success(sCommentSensitiveLogDomainService.page(requestPageVO));
    }

    /**
     * 新增评论敏感词记录表
     */
    @ValidatorRole
    @PostMapping("/create")
    public Result<Boolean> create(@RequestBody SCommentSensitiveLogRequestVO requestVO) {
        return Result.success(sCommentSensitiveLogDomainService.insert(requestVO));
    }

    /**
     * 修改评论敏感词记录表
     */
    @ValidatorRole
    @PostMapping("/update")
    public Result<Boolean> update(@RequestBody SCommentSensitiveLogRequestVO requestVO) {
        return Result.success(sCommentSensitiveLogDomainService.update(requestVO));
    }

    /**
     * 删除评论敏感词记录表
     */
    @ValidatorRole
    @DeleteMapping("/delete/{id}")
    public Result<Boolean> delete(@PathVariable("id") Long id) {
        return Result.success(sCommentSensitiveLogDomainService.delete(id));
    }

    /**
     * 获取评论敏感词记录表详情
     */
    @ValidatorRole
    @GetMapping("/get/{id}")
    public Result<SCommentSensitiveLogResponseVO> get(@PathVariable("id") Long id) {
        return Result.success(sCommentSensitiveLogDomainService.get(id));
    }
}
